package com.example.calender;

import android.graphics.Color;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.zackratos.ultimatebarx.library.UltimateBarX;
import com.zackratos.ultimatebarx.library.bean.BarConfig;

import java.util.concurrent.ScheduledThreadPoolExecutor;

public abstract class BaseActivity extends AppCompatActivity {

    public ScheduledThreadPoolExecutor threadPool;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(setLayout());
        overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);
        threadPool = ((BaseApplication) getApplication()).getThreadPool();
        UltimateBarX.with(this)
                .config(new BarConfig().fitWindow(true).color(Color.argb(255,3,169,244)).light(true))
                .applyStatusBar();
        findViews();
        initView();
        initListener();
        initData();
    }

    protected abstract int setLayout();
    protected abstract void findViews();
    protected abstract void initView();
    protected abstract void initListener();
    protected abstract void initData();

    @Override
    protected void onPause() {
        super.onPause();
        overridePendingTransition(R.anim.in_to_left,R.anim.out_from_right);
    }
}
